package com.infore.dataReceiving.core.parse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.infore.dataReceiving.core.chain.Water2018InstructionsChain;
import com.infore.dataReceiving.dto.WaterInstructionsDto;
import com.infore.dataReceiving.repository.IBackControlLogRepository;
import com.infore.dataReceiving.util.Water2018InstructionsHandleUtil;
import com.infore.dataReceiving.util.RedisUtil;
import com.infore.dataReceiving.util.ResultEntity;

import io.netty.channel.ChannelHandlerContext;

@Component("water2018InstructionsParse")
public class Water2018InstructionsParse implements InstructionsParse{

	@Autowired
    private RedisUtil redisUtil;// = new RedisUtil()
	
	@Autowired
	private IBackControlLogRepository repository;
	
	@Override
	public <T> ResultEntity parse(T t,ChannelHandlerContext ctx) {
		WaterInstructionsDto waterInstructionsDto = (WaterInstructionsDto)t;
		Water2018InstructionsChain chain = Water2018InstructionsHandleUtil.getMessageFilterChain();
		chain.doFilter(ctx,waterInstructionsDto,chain,redisUtil,repository,false);
		return null;
	}

}
